// ActionScript file
import mx.collections.XMLListCollection;
import mx.rpc.events.ResultEvent;

	private var dataset_magazine:XMLListCollection = new XMLListCollection();
	
	
	private function readyMagazineLink():void{
		reqMagazineLink.send();
	}
	
	private function loadedMagazineLink(event:ResultEvent):void{
		dataset_magazine.removeAll();
		dataset_magazine = new XMLListCollection(new XMLList(event.result.magazine));

		img_cover1.source = dataset_magazine.getItemAt(0).cover;
		img_cover2.source = dataset_magazine.getItemAt(1).cover;
		img_cover3.source = dataset_magazine.getItemAt(2).cover;
	}
	
	private function goContent(number:int):void{
		switch(number){
			case 1:
				link(dataset_magazine.getItemAt(0).content);
				break;
			case 2:
				link(dataset_magazine.getItemAt(1).content);
				break;
			case 3:
				link(dataset_magazine.getItemAt(2).content);
				break;
		}
	}